#include "gamewidget.h"
#include<QtGui/QApplicationStateChangeEvent>
#include<QTextCodec>

gamewidget::gamewidget(QWidget *parent) : QWidget(parent)
{
    this->resize(1000,659);
    this->setWindowTitle("捕鱼达人");//标题名称
    //this->setWindowIcon(QIcon(""));//标题上的图标

    QPalette palette;//调色板
    //palette.setColor(QPalette::Background,Qt::blue);
    //this->setPalette(palette);//设置背景颜色

    palette.setBrush(QPalette::Background,QBrush(QPixmap("D:/QT project/fish/sucai/beijin2.png")));//设置背景图片
    this->setPalette(palette);

    //添加按钮
    this->easybtn=new QPushButton(this);
    this->easybtn->setIcon(QIcon(":/annu4.png"));//按钮图片
    this->easybtn->setIconSize(QSize(200,80));//按钮大小
    this->easybtn->setFlat(true);
    this->setFocusPolicy(Qt::NoFocus);

    this->commonbtn=new QPushButton(this);
    this->commonbtn->setIcon(QIcon(":/annu5.png"));//按钮图片
    this->commonbtn->setIconSize(QSize(200,80));//按钮大小
    this->commonbtn->setFlat(true);
    this->setFocusPolicy(Qt::NoFocus);

    this->hardbtn=new QPushButton(this);
    this->hardbtn->setIcon(QIcon(":/annu6.png"));//按钮图片
    this->hardbtn->setIconSize(QSize(200,80));//按钮大小
    this->hardbtn->setFlat(true);
    this->setFocusPolicy(Qt::NoFocus);

    this->returnbtn=new QPushButton(this);
    this->returnbtn->setIcon(QIcon(":/annu7.png"));//按钮图片
    this->returnbtn->setIconSize(QSize(200,80));//按钮大小
    this->returnbtn->setFlat(true);
    this->setFocusPolicy(Qt::NoFocus);

    //创建一个垂直布局类
    this->vboxlayout=new QVBoxLayout(this);
    this->vboxlayout->addWidget(this->easybtn);
    this->vboxlayout->addWidget(this->commonbtn);
    this->vboxlayout->addWidget(this->hardbtn);
    this->vboxlayout->addWidget(this->returnbtn);
    this->vboxlayout->setAlignment(Qt::AlignCenter);

}
